]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
fileUtils: Make loadInterfaceXML usable from tests
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 8 Oct 2018 19:24:00 +0000 (21:24 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 8 Oct 2018 19:27:21 +0000 (21:27 +0200)
The current code assumes that the resource has been installed,
which isn't the case when running distcheck.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/255

js/misc/fileUtils.js

index 24add2e7e150984683c043014bdea4cd24fbc71e..32c08759ec4e27fc7d5b6df5a43405ea27411afe 100644 (file)
@@ -75,8 +75,9 @@ function recursivelyMoveDir(srcDir, destDir) {
 let _ifaceResource = null;
 function loadInterfaceXML(iface) {
     if (!_ifaceResource) {
-        // don't use global.datadir so the method is usable from tools
-        let path = Config.PKGDATADIR + '/gnome-shell-dbus-interfaces.gresource';
+        // don't use global.datadir so the method is usable from tests/tools
+        let dir = GLib.getenv ('GNOME_SHELL_DATADIR') || Config.PKGDATADIR;
+        let path = dir + '/gnome-shell-dbus-interfaces.gresource';
         _ifaceResource = Gio.Resource.load(path);
         _ifaceResource._register();
     }